<?php
	require('../Model/mysql.php');
	require('../host_config.php');
	$mysql = new MySQL();
    $link = $mysql->connect($mysql_host, $mysql_user, $mysql_passwd, $mysql_db);
    $imsi = $mysql->real($_POST["imsi"]);
	
    
   	$ouput = array();
	
	if ($imsi != NULL) {
		$sql = "SELECT `shopid`, `flag` FROM `Client` WHERE `imsi` = '$imsi'";
		$result = $mysql->query($sql, $link);
		while($e=mysql_fetch_assoc($result))
			$output[]=$e;

		if ($output == NULL)
			$output = array("fullname"=>0);
        print(json_encode($output));
	}else {
		echo "<script language='javascript'>";
		echo "alert('You have no permission to read this page!');";
		echo "history.back();";
		echo "</script>";
		header("location:../login.php");
	}
?>
